package com.innjia.sys.dao;

import com.innjia.sys.entity.ContractInfoEntity;
import com.innjia.base.dao.BaseDao;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 
 * 
 * @author innjia
 * @date 2017-11-14 09:56:19
 */
@Repository
public interface ContractInfoDao extends BaseDao<ContractInfoEntity> {

    List<ContractInfoEntity> searchQueryList(Map<String, Object> map);

    List<ContractInfoEntity> searchAppTenantList(Map<String, Object> map);

    int searchCountQueryList(Map<String, Object> map);

    int searchCountAppTenantList(Map<String, Object> map);

    int searchCountAppLandlordList(Map<String, Object> map);

    List<ContractInfoEntity> searchAppLandlordList(Map<String, Object> map);

    /**
     * 根据甲方签约bizNo查询
     * @param bizNoA
     * @return
     * ContractInfoEntity
     */
    ContractInfoEntity queryByBizNoA(@Param("bizNoA") String bizNoA);
    
    /**
     * 根据乙方签约bizNo查询
     * @param bizNoB
     * @return
     * ContractInfoEntity
     */
    ContractInfoEntity queryByBizNoB(@Param("bizNoB") String bizNoB);

    /**
     * 根据租客或者房东手机号查询待签约并且签约有效时限小于当前时间的合同
     * @param phone 可为空，为空时返回所有待签约状态并未有效时限小于当前时间的合同
     * @return
     * List<ContractInfoEntity>
     */
    List<ContractInfoEntity> queryByTenantOrLandlordPhone(@Param("phone") String phone);
    
    ContractInfoEntity queryHouseId(String houseId);

    ContractInfoEntity queryHouseCode(String houseCode);

    ContractInfoEntity searchPhone(Map<String, Object> map);

    List<ContractInfoEntity> searchContractQueryList();

    int dulfillmentOfContractRecords(Map<String, Object> map);

}
